import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/home/Home.vue'

Vue.use(Router)

// 按需引入时，组件名称需要首字母大写,否则无法识别
export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/views/sort/sort',
      name: 'sort',
      component: () =>import('./views/sort/Sort.vue')
    },
    {
      path: '/views/shopcart/shopcart',
      name: 'shopcart',
      component: () =>import('./views/shopcart/Shopcart.vue')
    },
    {
      path: '/views/personal/personal',
      name: 'personal',
      component: () =>import('./views/personal/Personal.vue')
    }
  ]
})
